bandwidthD        = 5;          %bandwidth in the cross-section dimension for step 1 and 3
bandwidthT        = 10;         %bandwidth in the time series dimension for step 1 and 3
bandwidthTstep2   = 1;          %bandwidth in the time series dimension for step 2
numSim            = 1D5;        % Length of simulated sample path
numBootStep2      = 0;          % Number of simulations in step 2 for the bias-adjustment
MultProcessOn     = 1;          %1 for using multiprocessing to compute the gradient in optimization, else 0
factorSignResOn   = 1;          % 1 for imposing sign restrictions on the factors, else 0
lambda            = 0.01;       % Tuning parameter for the NLS regressions
tolFunNLSfactors  = 1D-10;      % Convergences criteria for NLS regressions
if AVarTheta1On == 1
    tolFunNLSfactors  = 1D-14;
end
    
% Variables which we do not select for estimation are calibrated 
calibrateTheta1Step1 = struct();
for i=1:2*nm
   calibrateTheta1Step1.(['beta',num2str(i)]) = 0;
end
for i=1:nn
   calibrateTheta1Step1.(['beta',num2str(2*nm+i)]) = 1;
end
for i=1:2*nm+nn
    name = ['h0Q',num2str(i)];
    calibrateTheta1Step1.(name) = 0;
end
for i=1:2*nm+nn
   for j=1:2*nm+nn
        name = ['phi',num2str(i),num2str(j)];
        if i ~= j
            calibrateTheta1Step1.(name) = 0;
        end
   end
end
for i=1:2*nm+nn
   for j=1:i
        name = ['sigma',num2str(i),num2str(j)];
        if i ~= j
            calibrateTheta1Step1.(name) = 0;
        end
   end
end
calibrateTheta1Step1.rhor = 0;
